﻿@using Easy.ViewPort.Descriptor
@using Easy.Web.Metadata
@model Object
@{
    var meteData = ViewData.ModelMetadata as EasyModelMetaData;
    var descriptor = meteData.ViewPortDescriptor as DropDownListDescriptor;
    SelectList list;
    if (descriptor.SourceType == SourceType.ViewData)
    {
        list = new SelectList(ViewData[descriptor.SourceKey] as SelectList, "Value", "Text", Model);
    }
    else
    {
        list = new SelectList(descriptor.OptionItems, "Key", "Value", Model);
    }
}
@Html.DropDownList("", list, meteData.GetAttributes())